\RequirePackage{xspace}
\RequirePackage{ifmtarg}

\let\smallOld\small
\renewcommand{\small}{\color{gray} \smallOld}

\newcommand{\ssi}{si et seulement si\xspace}
\newcommand{\ac}{avec\xspace}

\newcommand{\cad}{c'est-à-dire\xspace}
\newcommand{\Cad}{C'est-à-dire\xspace}

\newcommand{\er}{\up{ier}\xspace}
\newcommand{\ere}{\up{ère}\xspace}
\newcommand{\nd}{\up{nd}\xspace}
\renewcommand{\ieme}{\up{ième}\xspace}

%%% raccourci de langage %%%
\newcommand{\ens}{ensemble\xspace}
\newcommand{\elem}{élément\xspace}
\newcommand{\elems}{éléments\xspace}
\newcommand{\sgp}{semi-grou\-pe\xspace}
\newcommand{\pol}{polynôme\xspace}
\newcommand{\mono}{monoïde\xspace}
\newcommand{\lci}{loi de composition interne\xspace}
\newcommand{\coef}{c\oe fficient\xspace}

\newcommand{\nom}[1]{\textsc{#1}}
\newcommand{\num}[1]{#1}%\oldstylenums{#1}}

\newcommand{\sectione}[2][]
    {\@ifmtarg{#1}
        {\section*{#2}\addcontentsline{toc}{section}{#2}}
        {\section*{#2}\addcontentsline{toc}{section}{#1}}
    }
\newcommand{\subsectione}[2][]
    {\@ifmtarg{#1}
        {\subsection*{#2}\addcontentsline{toc}{subsection}{#2}}
        {\subsection*{#2}\addcontentsline{toc}{subsection}{#1}}
    }
\newcommand{\subsubsectione}[2][]
    {\@ifmtarg{#1}
        {\subsubsection*{#2}\addcontentsline{toc}{subsubsection}{#2}}
        {\subsubsection*{#2}\addcontentsline{toc}{subsubsection}{#1}}
    }

\let\biblioOld\bibliography
\renewcommand{\bibliography}[1]{\biblioOld{#1}\addcontentsline{toc}{section}{Références}}